package boot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableScheduling;

import com.xes.apps.ams.client.rd60n.JCRD60N;
import com.xes.apps.ams.config.ServerConfig;

@Configuration
@EnableAutoConfiguration
@ComponentScan("com.xes.apps.ams.*,com.xes.apps.ams.client.core.service.*")
@EnableScheduling
@EnableConfigurationProperties({ ServerConfig.class })
@ImportResource(locations = "application-config.xml")
@EnableCaching
public class Application extends SpringBootServletInitializer {

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(Application.class);
	}

	public static void main(String[] args) throws Exception {
		JCRD60N client = new JCRD60N();
		client.run();
		SpringApplication.run(Application.class, args);
	}

}
